/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.templates.subsystems;

import edu.wpi.first.wpilibj.AnalogChannel;
import edu.wpi.first.wpilibj.Victor;
import edu.wpi.first.wpilibj.command.PIDSubsystem;

/**
 *
 * @author Conor
 */
public class FanPID extends PIDSubsystem {
     
     public Victor fanMotor = new Victor(2);
     public AnalogChannel sonar = new AnalogChannel(2);
    
    
    public FanPID() {
        super("FanPID", 2.0, 0.0, 0.0);
        setAbsoluteTolerance(0.05);
        getPIDController().setContinuous(false);
    }

    protected double returnPIDInput() {
        double sonarDistance = sonar.getVoltage()*100;
        return sonarDistance;
        
    }

    protected void usePIDOutput(double output) {
        fanMotor.pidWrite(output);
    }

    protected void initDefaultCommand() {
    }
    
}
